package com.chaosyeb.server.utils;

import com.chaosyeb.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @Description : 操作员工具类
 * @Author : Chaos
 * @Date : 2022/1/11 17:05
 * @Version : 1.0
 **/
public class AdminUtils {
    /**
     * 获取当前登录的操作员
     *
     * @return
     */
    public static Admin getCurrentAdmin() {
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
